package com.srit.yoggsaron.db.model;

public enum RoleEnumType {
		LEADER("研发经理", Role.ROLE_TYPE_LEADER), //
		DEVELOPER("开发者 ", Role.ROLE_TYPE_DEVELOPER), //
		VISITOR("浏览", Role.ROLE_TYPE_VISITOR);

		private String text = null;
		private Integer value = -1;

		RoleEnumType(String text, Integer value) {
			this.text = text;
			this.value = value;
		}
		public String getText() {
			return text;
		}
		public void setText(String text) {
			this.text = text;
		}
		public Integer getValue() {
			return value;
		}
		public void setValue(Integer value) {
			this.value = value;
		}
		@Override
		public String toString() {
			return text;
		}
		public static RoleEnumType getEnumType(int type)
		{
			return RoleEnumType.valueOf( type+"");
		}
		public static RoleEnumType getEnumType(String text)
		{
			if(text==null ||text.trim().length()==0)
				return null;
			for(RoleEnumType c: RoleEnumType.values())
			{
				if( c.getText().equals(text) )
					return c;
			}
			for(RoleEnumType c: RoleEnumType.values())
			{
				if( c.getValue().toString().equals(text) )
					return c;
			}
			return null;
		}
	 

	
	
}
